﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Dialog.Master" AutoEventWireup="true"
    CodeBehind="UserCreate.aspx.cs" Inherits="NetDon.OA.Portal.Admin.UserCreate" %>

<%@ Register Src="../Components/Position.ascx" TagName="PositionControl" TagPrefix="uc1" %>
<%@ Register Src="../Components/ComanyDepartment.ascx" TagName="ComanyDepartment"
    TagPrefix="uc1" %>
<%@ Register TagPrefix="uc2" TagName="RequiredMark" Src="~/Controls/RequiredMark.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel runat="server" DefaultButton="btnSave" ID="Panel1">
        <NetDon:FormPanel ID="panelUser" runat="server" RepeatColumns="2">
            <Items>
                <NetDon:FormItem FullRow="true" HeaderVisible="false">
                    <ContentTemplate>
                        <asp:Literal ID="Literal1" runat="server" Text="基本信息"></asp:Literal>
                    </ContentTemplate>
                </NetDon:FormItem>
                <NetDon:FormItem HeaderText="用户">
                    <ContentTemplate>
                        <asp:TextBox runat="server" ID="txtUserName" Text='<%#Bind("UserName") %>' MaxLength="50"></asp:TextBox>
                        <uc2:RequiredMark runat="Server"></uc2:RequiredMark>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ValidationExpression="^[0-9a-zA-Z]+$"
                            ErrorMessage="用户名必须是字母或数字！" Display="Dynamic" ControlToValidate="txtUserName"></asp:RegularExpressionValidator>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtUserName"
                            Display="None" ErrorMessage="请输入用户名" SetFocusOnError="True"></asp:RequiredFieldValidator>
                    </ContentTemplate>
                </NetDon:FormItem>
                <NetDon:FormItem HeaderText="姓名">
                    <ContentTemplate>
                        <asp:TextBox runat="server" ID="txtFullName" Text='<%#Bind("FullName") %>' MaxLength="50"></asp:TextBox>
                    </ContentTemplate>
                </NetDon:FormItem>
                <NetDon:FormItem HeaderText="类型">
                    <ContentTemplate>
                        <asp:RadioButtonList ID="radioUserType" runat="server" RepeatColumns="2" AutoPostBack="true"
                            OnSelectedIndexChanged="radioUserType_SelectedIndexChanged">
                            <asp:ListItem Text="内部员工" Value="1" Selected="True"></asp:ListItem>
                          <%--  <asp:ListItem Text="门店用户" Value="2"></asp:ListItem>--%>
                        </asp:RadioButtonList>
                    </ContentTemplate>
                </NetDon:FormItem>
                <NetDon:FormItem HeaderText="角色" Key="Role">
                    <ContentTemplate>
                        <asp:DropDownList ID="chlRoles" runat="server" DataSourceID="ObjectDataSourceRoles"
                            DataTextField="RoleName" DataValueField="RoleId" AppendDataBoundItems="true">
                        </asp:DropDownList>
                        <asp:ObjectDataSource ID="ObjectDataSourceRoles" runat="server" OldValuesParameterFormatString="original_{0}"
                            SelectMethod="RetrieveAdministratorRoles" TypeName="NetDon.OA.Business.MiscDataSource">
                        </asp:ObjectDataSource>
                    </ContentTemplate>
                </NetDon:FormItem>
                <NetDon:FormItem HeaderVisible="false" Key="Company" ColumnSpan="2">
                    <ContentTemplate>
                        <uc1:ComanyDepartment ID="ucCompanyDepartment" runat="server"></uc1:ComanyDepartment>
                    </ContentTemplate>
                </NetDon:FormItem>
                <NetDon:FormItem HeaderText="岗位" Key="Position">
                    <ContentTemplate>
                        <NetDon:PositionDropDown runat="server" ID="ddlPosition">
                        </NetDon:PositionDropDown>
                    </ContentTemplate>
                </NetDon:FormItem>
          
                <NetDon:FormItem FullRow="true" HeaderVisible="false">
                    <ContentTemplate>
                        <asp:Literal ID="Literal2" runat="server" Text="其它信息"></asp:Literal>
                    </ContentTemplate>
                </NetDon:FormItem>
                <NetDon:FormItem HeaderText="别名" ColumnSpan="2">
                    <ContentTemplate>
                        <asp:TextBox runat="server" ID="txtNickName" Text='<%#Bind("NickName") %>' MaxLength="50"></asp:TextBox>
                        <%--   <span>用户可用此别名登录系统，别名不能与其他用户的别名或用户名相同</span>--%>
                    </ContentTemplate>
                </NetDon:FormItem>
                <NetDon:FormItem HeaderText="性别">
                    <ContentTemplate>
                        <asp:DropDownList ID="ddlGender" runat="server" DataSourceID="EnumDataSourceUserGender"
                            DataTextField="Description" DataValueField="Name">
                        </asp:DropDownList>
                        <NetDon:EnumDataSource ID="EnumDataSourceUserGender" runat="server" TypeName="NetDon.OA.Interface.GenderType">
                        </NetDon:EnumDataSource>
                    </ContentTemplate>
                </NetDon:FormItem>
                <NetDon:FormItem HeaderText="生日">
                    <ContentTemplate>
                        <asp:TextBox ID="txtBirthday" runat="server" Width="70px"></asp:TextBox>
                        <asp:MaskedEditExtender ID="txtBirthday_MaskedEditExtender" runat="server" ClearTextOnInvalid="True"
                            ClipboardEnabled="False" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder=""
                            CultureDateFormat="DMY" CultureDatePlaceholder="" CultureDecimalPlaceholder=""
                            CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" MaskType="Date"
                            TargetControlID="txtBirthday" UserDateFormat="YearMonthDay" Mask="9999-99-99"
                            Century="2000">
                        </asp:MaskedEditExtender>
                        <asp:CalendarExtender ID="txtBirthday_CalendarExtenderBirthday" runat="server" Animated="False"
                            Enabled="True" FirstDayOfWeek="Sunday" TargetControlID="txtBirthday" Format="yyyy-MM-dd">
                        </asp:CalendarExtender>
                        <asp:CustomValidator ID="txtBirthdayDateFormatValidator" ClientValidationFunction="validateDateText"
                            runat="server" ErrorMessage="用户生日无效." Display="None" ControlToValidate="txtBirthday"
                            OnServerValidate="DateValidator_ServerValidate"></asp:CustomValidator>
                    </ContentTemplate>
                </NetDon:FormItem>
                <NetDon:FormItem HeaderText="手机">
                    <ContentTemplate>
                        <asp:TextBox runat="server" ID="txtMobilePhone" Text='<%#Bind("Mobile") %>' MaxLength="50"></asp:TextBox>
                    </ContentTemplate>
                </NetDon:FormItem>
                <NetDon:FormItem HeaderText="Email">
                    <ContentTemplate>
                        <asp:TextBox runat="server" ID="txtEmail" Text='<%#Bind("Email") %>' MaxLength="50"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtEmail"
                            Display="None" SetFocusOnError="True" ErrorMessage="邮箱格式错误" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                    </ContentTemplate>
                </NetDon:FormItem>
                <NetDon:FormItem HeaderText="地址" ColumnSpan="2">
                    <ContentTemplate>
                        <asp:TextBox runat="server" ID="txtAdress" Text='<%#Bind("Address") %>' MaxLength="500"
                            TextMode="MultiLine" Height="100" Width="480"></asp:TextBox>
                    </ContentTemplate>
                </NetDon:FormItem>
            </Items>
        </NetDon:FormPanel>
        <div style="margin: 10px; text-align: center">
            <asp:Button ID="btnSave" runat="server" Text="保存" OnClick="btnSave_Click" Style="margin-right: 5px">
            </asp:Button>
            <asp:Button ID="btnCancel" runat="server" Text="取消" CausesValidation="false" SkinID="Button60"
                Style="margin-left: 5px"></asp:Button>
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="List"
                ShowMessageBox="True" ShowSummary="False" />
        </div>
    </asp:Panel>
</asp:Content>
